/**
 * 
 */
package com.antilia.infomaresme.pages.edit;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;

import com.antilia.infomaresme.data.dataobjects.ImageInfo;
import com.antilia.infomaresme.link.JQIcon;
import com.antilia.infomaresme.link.JqAjaxLink;

/**
 * @author Ernesto
 *
 */
public abstract class DetailsFileUploadLinkPanel extends Panel {

	private static final long serialVersionUID = 1L;

	/**
	 * @param id
	 * @param model
	 */
	public DetailsFileUploadLinkPanel(String id, final IModel<ImageInfo> model) {
		super(id, model);
		JqAjaxLink link = new JqAjaxLink("details", JQIcon.ui_icon_zoomin, new ResourceModel("actions.view")) {
			
			private static final long serialVersionUID = 1L;

			@Override
			public void onClick(AjaxRequestTarget target) {
				DetailsFileUploadLinkPanel.this.onSee(target, model);				
			}
		};
		add(link);
		
		link = new JqAjaxLink("delete", JQIcon.ui_icon_close, new ResourceModel("actions.delete")) {
			
			private static final long serialVersionUID = 1L;

			@Override
			public void onClick(AjaxRequestTarget target) {
				DetailsFileUploadLinkPanel.this.onDelete(target, model);				
			}
		};
		add(link);
		
	}

	public abstract void onSee(AjaxRequestTarget target, IModel<ImageInfo> model);
	
	
	public abstract void onDelete(AjaxRequestTarget target, IModel<ImageInfo> model);
	
}
